
\usepackage[utf8]{inputenc} 

\usepackage{graphicx} % Add graphics capabilities
\usepackage{booktabs} % for much better looking tables
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{wrapfig}
\usepackage{sidecap}

% Pretty fonts
\usepackage{bookman}
 
% More pleasant margins
\usepackage[twoside,inner=3cm,top=2.5cm,outer=1.5cm,bottom=3cm]{geometry}
 
% Use \vref in stead of \ref for pretty references
\usepackage{varioref}
 
% Make headers prettier
\usepackage{fancyhdr}

%\fancypagestyle{plain}{%
%\fancyhf{} %Clears all header and footer fields, in preparation.
%\fancyfoot[LO,RE]{\thepage} %Displays the page number in the footer, left on odd page and right on  even.
%\fancyfoot[RO,LE]{\thepage} %Displays the page number in the footer, right on odd page and left on  even.
%\fancyfoot[RE]{\textbf{\title}} % Document title on left footer
%\fancyfoot[LO]{\textit{\author}}
%to the left on even pages and to the right on odd pages.
%\fancyhead[LE]{\nouppercase{\leftmark}} %Displays the upper-level (section) information -
%as determined above - in non-upper case in the header, to the left on odd pages.
%\fancyhead[LO]{} %Displays the lower-level (chapter) information - as
%determined above - in the header, to the left on odd pages.
%\renewcommand{\headrulewidth}{0pt} %Underlines the header. (Set to 0pt if not required).
%\renewcommand{\headwidth}{\textwidth}
%\renewcommand{\footrulewidth}{0.5pt} %Underlines the footer. (Set to 0pt if not required).
%}

\DeclareGraphicsExtensions{.png,.jpg}


% COLORS (Tango)
\definecolor{LightButter}{rgb}{0.98,0.91,0.31}
\definecolor{LightOrange}{rgb}{0.98,0.68,0.24}
\definecolor{LightChocolate}{rgb}{0.91,0.72,0.43}
\definecolor{LightChameleon}{rgb}{0.54,0.88,0.20}
\definecolor{LightSkyBlue}{rgb}{0.45,0.62,0.81}
\definecolor{LightPlum}{rgb}{0.68,0.50,0.66}
\definecolor{LightScarletRed}{rgb}{0.93,0.16,0.16}
\definecolor{Butter}{rgb}{0.93,0.86,0.25}
\definecolor{Orange}{rgb}{0.96,0.47,0.00}
\definecolor{Chocolate}{rgb}{0.75,0.49,0.07}
\definecolor{Chameleon}{rgb}{0.45,0.82,0.09}
\definecolor{SkyBlue}{rgb}{0.20,0.39,0.64}
\definecolor{Plum}{rgb}{0.46,0.31,0.48}
\definecolor{ScarletRed}{rgb}{0.80,0.00,0.00}
\definecolor{DarkButter}{rgb}{0.77,0.62,0.00}
\definecolor{DarkOrange}{rgb}{0.80,0.36,0.00}
\definecolor{DarkChocolate}{rgb}{0.56,0.35,0.01}
\definecolor{DarkChameleon}{rgb}{0.30,0.60,0.02}
\definecolor{DarkSkyBlue}{rgb}{0.12,0.29,0.40}
\definecolor{blue}{rgb}{0.0, 0.0, 0.9}
\definecolor{DarkGreen}{rgb}{0.12,0.40,0.29}
\definecolor{DarkPlum}{rgb}{0.36,0.21,0.40}
\definecolor{DarkScarletRed}{rgb}{0.64,0.00,0.00}
\definecolor{Aluminium1}{rgb}{0.93,0.93,0.92}
\definecolor{Aluminium2}{rgb}{0.82,0.84,0.81}
\definecolor{Aluminium3}{rgb}{0.73,0.74,0.71}
\definecolor{Aluminium4}{rgb}{0.53,0.54,0.52}
\definecolor{Aluminium5}{rgb}{0.33,0.34,0.32}
\definecolor{Aluminium6}{rgb}{0.18,0.20,0.21}

\lstdefinelanguage{CppKdeSupport}{
	% classes:
	morekeywords=[1]{class, public, private, protected, slots, signals, this},
	% variables:
	morekeywords=[2]{int, char, double, float, void, bool},
	% Qt Classes
	morekeywords=[3]{QAbstractButton, QFlag, QMutex, QStyleOptionTab, QAbstractEventDispatcher, QFlags, QMutexLocker,
	QStyleOptionTabBarBase, QAbstractExtensionFactory, QFocusEvent,	QNetworkAccessManager, QStyleOptionTabV2,
	QAbstractExtensionManager, QFocusFrame, QNetworkAddressEntry,  QStyleOptionTabWidgetFrame, QAbstractFileEngine, QFont,
	QNetworkCookie, QStyleOptionTitleBar, QAbstractFileEngineHandler, QFontComboBox, QNetworkCookieJar,
	QStyleOptionToolBar, QAbstractFileEngineIterator, QFontDatabase,	QNetworkInterface, QStyleOptionToolBox, QAbstractFontEngine, 
	QFontDialog, QNetworkProxy, QStyleOptionToolBoxV2, QAbstractFormBuilder, QFontEngineInfo, QNetworkReply,
	QStyleOptionToolButton, QAbstractGraphicsShapeItem, QFontEnginePlugin, QNetworkRequest, QStyleOptionViewItem, QAbstractItemDelegate,
	QFontInfo, QStyleOptionViewItemV2, QAbstractItemModel, QFontMetrics, QObject, QStyleOptionViewItemV4, QAbstractItemView, QFontMetricsF,
	QObjectCleanupHandler, QStylePainter, QAbstractListModel, QFormBuilder, QStylePlugin, QAbstractMessageHandler, QFormLayout,
	QPageSetupDialog, QSvgGenerator, QAbstractPrintDialog, QFrame, QPaintDevice, QSvgRenderer, QAbstractProxyModel, QFSFileEngine,
	QPaintEngine, QSvgWidget, QAbstractScrollArea, QFtp, QPaintEngineState, QSyntaxHighlighter, QAbstractSlider, QFuture, QPainter,
	QSysInfo, QAbstractSocket, QFutureIterator, QPainterPath, QSystemLocale, QAbstractSpinBox,	QFutureSynchronizer, QPainterPathStroker,
	QSystemSemaphore, QAbstractTableModel, QFutureWatcher, QPaintEvent, QSystemTrayIcon, QAbstractTextDocumentLayout,
	QGenericArgument, QPair, QTabBar, QAbstractUriResolver, QGenericReturnArgument, QPalette, QTabletEvent, QAbstractXmlNodeModel, QGLColormap, 
	QTableView, QAbstractXmlReceiver, QGLContext, QPen, QTableWidget, QAccessible, QGLFormat, QPersistentModelIndex, QTableWidgetItem, QAccessibleBridge,
	QGLFramebufferObject, QPicture, QTableWidgetSelectionRange, QAccessibleBridgePlugin, QGLPixelBuffer, QPictureFormatPlugin, QTabWidget, QAccessibleEvent, QGLWidget,
	QPictureIO, QTcpServer, QAccessibleInterface, QGradient, QPixmap, QTcpSocket, QAccessibleObject, QGraphicsEllipseItem, QPixmapCache, QTemporaryFile,
	QGraphicsGridLayout, QPlainTextDocumentLayout, QTestEventList, QAccessibleWidget, QGraphicsItem, QPlainTextEdit, QTextBlock, QAction, QGraphicsItemAnimation,
	QPlastiqueStyle, QTextBlockFormat, QActionEvent, QGraphicsItemGroup, QPluginLoader, QTextBlockGroup, QActionGroup, QGraphicsLayout, QPoint,
	QTextBlockUserData, QApplication, QGraphicsLayoutItem, QPointer, QTextBoundaryFinder, QAssistantClient, QGraphicsLinearLayout, QPointF, QTextBrowser, QAtomicInt,
	QGraphicsLineItem, QPolygon, QTextCharFormat, QAtomicPointer, QGraphicsPathItem, QPolygonF, QTextCodec, QGraphicsPixmapItem, QPrintDialog,
	QTextCodecPlugin, QAuthenticator, QGraphicsPolygonItem, QPrintEngine, QTextCursor, QAxAggregated, QGraphicsProxyWidget, QPrinter, QTextDecoder, QAxBase,
	QGraphicsRectItem, QPrinterInfo, QTextDocument, QAxBindable, QGraphicsScene, QPrintPreviewDialog, QTextDocumentFragment, QAxFactory, QGraphicsSceneContextMenuEvent,
	QPrintPreviewWidget, QTextEdit, QAxObject, QGraphicsSceneDragDropEvent, QProcess, QTextEncoder, QAxScript, QGraphicsSceneEvent, QProgressBar,  QTextFormat,
	QAxScriptEngine, QGraphicsSceneHelpEvent, QProgressDialog, QTextFragment, QAxScriptManager, QGraphicsSceneHoverEvent, QProxyModel, QTextFrame, QAxWidget,
	QGraphicsSceneMouseEvent, QProxyScreen, QTextFrameFormat, QBasicTimer, QGraphicsSceneMoveEvent, QPushButton, QTextImageFormat, QBitArray, QGraphicsSceneResizeEven,
	QQueue, QTextInlineObject, QBitmap, QGraphicsSceneWheelEvent, QRadialGradient, QTextItem, QBoxLayout, QGraphicsSimpleTextItem, QRadioButton, QTextLayout, QBrush,
	QGraphicsSvgItem, QRasterPaintEngine, QTextLength, QBuffer, QGraphicsTextItem, QReadLocker, QTextLine, QButtonGroup, QGraphicsView, QReadWriteLock,
	QTextList, QByteArray, QGraphicsWidget, QHelpEvent, QAccessiblePlugin,
	QRect, QTextListFormat, QByteArrayMatcher, QGridLayout, QRectF, QTextObject, QCache, QGroupBox, QRegExp, QTextOption, QCalendarWidget, QHash, QRegExpValidator,
	QTextStream, QCDEStyle, QHashIterator, QRegion, QTextTable, QChar, QHBoxLayout, QResizeEvent, QTextTableCell, QCheckBox, QHeaderView, QResource,
	QTextTableCellFormat, QChildEvent, QHelpContentItem, QRubberBand, QTextTableFormat, QCleanlooksStyle, QHelpContentModel, QRunnable, QThread, QClipboard,
	QHelpContentWidget, QScreen, QThreadPool, QCloseEvent, QHelpEngine, QScreenCursor, QThreadStorage, QColor, QHelpEngineCore, QScreenDriverFactory, QTime, QColorDialog,
	QScreenDriverPlugin, QTimeEdit, QColormap, QHelpIndexModel, QScriptable, QTimeLine, QColumnView, QHelpIndexWidget, QScriptClass, QTimer, QComboBox, QHelpSearchEngine,
	QScriptClassPropertyIterator, QTimerEvent, QCommandLinkButton, QHelpSearchQuery, QScriptContext, QToolBar, QCommonStyle, QHelpSearchQueryWidget, QScriptContextInfo,
	QToolBox, QCompleter, QHelpSearchResultWidget, QScriptEngine, QToolButton, QConicalGradient, QHideEvent, QScriptEngineAgent, QToolTip, QContextMenuEvent,
	QScriptExtensionPlugin, QTransform, QCopChannel, QHostInfo, QScriptString, QTranslator, QCoreApplication, QHoverEvent, QScriptValue, QTreeView, QCryptographicHash,
	QHttp, QScriptValueIterator, QTreeWidget, QCursor, QHttpHeader, QScrollArea, QTreeWidgetItem, QCustomRasterPaintDevice, QHttpRequestHeader, QScrollBar,
	QTreeWidgetItemIterator, QDataStream, QHttpResponseHeader, QUdpSocket, QDataWidgetMapper, QIcon, QSemaphore, QUiLoader, QDate, QIconDragEvent, QSessionManager,
	QUndoCommand, QDateEdit, QIconEngine, QSet, QUndoGroup, QDateTime, QIconEnginePlugin, QSetIterator, QUndoStack, QDateTimeEdit, QIconEnginePluginV2, QSettings,
	QUndoView, QDBusAbstractAdaptor, QIconEngineV2, QSharedData, QDBusAbstractInterface, QImage, QSharedDataPointer, QUrl, QDBusArgument,
	QImageIOHandler, QSharedMemory, QUrlInfo, QDBusConnection, QImageIOPlugin, QShortcut, QUuid, QDBusConnectionInterface, QImageReader, QShortcutEvent,
	QValidator, QDBusContext, QImageWriter, QShowEvent, QVariant, QDBusError, QInputContext, QSignalMapper, QVarLengthArray, QDBusInterface, QInputContextFactory,
	QSignalSpy, QVBoxLayout, QDBusMessage, QInputContextPlugin, QSimpleXmlNodeModel, QVector, QDBusObjectPath, QInputDialog, QSize, QVectorIterator, QDBusReply,
	QInputEvent, QSizeF, QDBusServer, QInputMethodEvent, QSizeGrip, QDBusSignature, QIntValidator, QSizePolicy, QHostAddress,
	QDBusVariant, QIODevice, QSlider,  QWaitCondition, QDecoration, QItemDelegate, QSocketNotifier, QWebFrame, QDecorationDefault, QItemEditorCreator,
	QSortFilterProxyModel, QWebHistory, QDecorationFactory, QItemEditorCreatorBase, QSound, QWebHistoryInterface, QDecorationPlugin, QItemEditorFactory, QSourceLocation,
	QWebHistoryItem, QDesignerActionEditorInterface, QItemSelection, QSpacerItem, QWebHitTestResult, QDesignerContainerExtension, QItemSelectionModel, QSpinBox,
	QWebPage, QDesignerCustomWidgetCollectionInterface, QItemSelectionRange, QSplashScreen, QWebPluginFactory, QDesignerCustomWidgetInterface, QKbdDriverFactory,
	QSplitter, QWebSettings, QDesignerDynamicPropertySheetExtension, QKbdDriverPlugin, QSplitterHandle, QWebView, QDesignerFormEditorInterface, QKeyEvent, QSqlDatabase,
	QWhatsThis, QDesignerFormWindowCursorInterface, QKeySequence, QSqlDriver, QWhatsThisClickedEvent, QDesignerFormWindowInterface, QLabel, QSqlDriverCreator,
	QWheelEvent, QDesignerFormWindowManagerInterface, QLatin1Char, QSqlDriverCreatorBase, QWidget, QDesignerMemberSheetExtension, QLatin1String, QSqlDriverPlugin,
	QWidgetAction, QDesignerObjectInspectorInterface, QLayout, QSqlError, QWidgetItem, QDesignerPropertyEditorInterface, QLayoutItem, QSqlField,
	QWindowsMime, QDesignerPropertySheetExtension, QLCDNumber, QSqlIndex, QWindowsStyle, QDesignerTaskMenuExtension, QLibrary, QSqlQuery,
	QWindowStateChangeEvent, QDesignerWidgetBoxInterface, QLibraryInfo, QSqlQueryModel, QWindowsVistaStyle, QDesktopServices, QLine, QSqlRecord,
	QWindowsXPStyle, QDesktopWidget, QLinearGradient, QSqlRelation, QWizard, QDial, QLineEdit, QSqlRelationalDelegate, QWizardPage, QDialog, QLineF,
	QWorkspace, QDialogButtonBox, QLinkedList, QSqlResult, QWriteLocker, QDir, QLinkedListIterator, QSqlTableModel, QWSCalibratedMouseHandler, QDirectPainter, QList,
	QSslCertificate, QWSClient, QDirIterator, QListIterator, QSslCipher, QWSEmbedWidget, QDirModel, QListView, QSslConfiguration, QWSEvent, QDockWidget, QListWidget,
	QSslError, QWSGLWindowSurface, QDomAttr, QListWidgetItem, QSslKey, QWSInputMethod, QDomCDATASection, QLocale, QSslSocket, QWSKeyboardHandler, QDomCharacterData,
	QLocalServer, QStack, QWSMouseHandler, QDomComment, QLocalSocket, QStackedLayout, QWSPointerCalibrationData, QDomDocument, QMacPasteboardMime, QStackedWidget,
	QWSScreenSaver, QDomDocumentFragment, QMacStyle, QStandardItem, QWSServer, QDomDocumentType, QMainWindow, QStandardItemEditorCreator, QWSWindow, QDomElement, QMap,
	QStandardItemModel, QX11EmbedContainer, QDomEntity, QMapIterator, QStatusBar, QX11EmbedWidget, QDomEntityReference, QMatrix, QStatusTipEvent,
	QX11Info, QDomImplementation, QMdiArea, QString, QXmlAttributes, QDomNamedNodeMap, QMdiSubWindow, QStringList, QXmlContentHandler, QDomNode,
	QStringListModel, QXmlDeclHandler, QDomNodeList,  QStringMatcher, QXmlDefaultHandler, QDomNotation,  QStringRef, QSqlRelationalTableModel,
	QXmlDTDHandler, QDomProcessingInstruction, QStyle, QXmlEntityResolver, QDomText, QMenu, QStyledItemDelegate, QXmlErrorHandler, QDoubleSpinBox,
	QMenuBar, QStyleFactory, QXmlFormatter, QDoubleValidator, QMessageBox, QStyleHintReturn, QXmlInputSource, QDrag, QMetaClassInfo, QStyleHintReturnMask,
	QXmlItem, QDragEnterEvent, QMetaEnum, QStyleHintReturnVariant, QXmlLexicalHandler, QDragLeaveEvent, QMetaMethod, QStyleOption, QXmlLocator, QDragMoveEvent,
	QStyleOptionButton, QXmlName, QDropEvent, QMetaProperty, QStyleOptionComboBox, QXmlNamePool, QDynamicPropertyChangeEvent, QMetaType, QStyleOptionComplex,
	QXmlNamespaceSupport, QMimeData, QStyleOptionDockWidget, QXmlNodeModelIndex, QMimeSource, QStyleOptionFocusRect, QMetaObject,
	QXmlParseException, QModelIndex, QStyleOptionFrame, QXmlQuery, QErrorMessage, QMotifStyle, QStyleOptionFrameV2, QXmlReader, QEvent,
	QMouseDriverFactory, QStyleOptionGraphicsItem, QXmlResultItems, QEventLoop, QMouseDriverPlugin, QStyleOptionGroupBox, QXmlSerializer,
	QMouseEvent, QStyleOptionHeader, QXmlSimpleReader, QExplicitlySharedDataPointer, QMoveEvent, QStyleOptionMenuItem, QXmlStreamAttribute, QExtensionFactory, QMovie,
	QStyleOptionProgressBar, QXmlStreamAttributes, QExtensionManager, QMultiHash, QStyleOptionProgressBarV2, QXmlStreamEntityDeclaration,F 	QFile, QMultiMap,
	QStyleOptionQ3DockWindow, QXmlStreamEntityResolver, QFileDialog, QMutableHashIterator, QStyleOptionQ3ListView, QXmlStreamNamespaceDeclaration, QFileIconProvider,
	QMutableLinkedListIterator, QStyleOptionQ3ListViewItem, QXmlStreamNotationDeclaration, QFileInfo, QMutableListIterator, QStyleOptionRubberBand,
	QXmlStreamReader, QFileOpenEvent, QMutableMapIterator, QStyleOptionSizeGrip, QXmlStreamWriter, QFileSystemModel, QMutableSetIterator, QStyleOptionSlider,
	QFileSystemWatcher, QMutableVectorIterator, QStyleOptionSpinBox
	},	
	% KDE Classes
	morekeywords=[4]{KApplication, KXMLGuiWindow, KPushButton, KMenu, KTabBar, KTextEditor, KAboutData, ki18n, KGuiItem, KMessageBox, KCmdLineArgs, KActionCollection},	
	% Qt Macros
	morekeywords=[5]{Q_OBJECT, Q_PROPERTY, READ, WRITE, SLOT, SIGNAL, connect, disconnect},
	morekeywords=[6]{if, for, else, while, do, case, switch, foreach, forever, new},
	% pre compiler directives 
	morecomment=[s]{/*}{*/},%
	morecomment=[l]//,% nonstandard
	morestring=[b]",%
	morestring=[b]',
	sensitive=true,
	moredelim=*[directive]\#,
	moredirectives={define,elif,else,endif,error,if,ifdef,ifndef,line,
	include,pragma,undef,warning, emit},
	basicstyle=\ttfamily\scriptsize,
  }[keywords,comments,strings,directives]%

\lstset{
  language=CppKdeSupport,
  showspaces=false,
  showtabs=false,
  frame=single,
  showstringspaces=false,
  keywordstyle=[1]{\color{DarkSkyBlue}},
  keywordstyle=[2]{\color{DarkScarletRed}},
  keywordstyle=[3]{\color{DarkGreen}},
  keywordstyle=[4]{\color{blue}},
  keywordstyle=[5]{\color{Chocolate}},
  keywordstyle=[6]{\bfseries},
  commentstyle={\color{Aluminium4}},
  stringstyle={\color{Chocolate}},
  tabsize=4,
  breaklines=true,
  basicstyle={\ttfamily},
  xleftmargin=5pt,
  xrightmargin=5pt,
  rulecolor=\color{black!30},
  captionpos=b,
  framesep=10pt,
  framexleftmargin=18pt,
  numbers=none,
  numberstyle={\tiny},
  stepnumber=1,
  numbersep=15pt
}

\usepackage{hyperref}
\hypersetup{
	linkcolor=DarkSkyBlue,
	citecolor= DarkSkyBlue,
	filecolor= DarkSkyBlue,
	urlcolor= DarkSkyBlue,
	backref,  
	pdfpagemode=FullScreen
}